<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>

    <div>
        <p class="pram">段落1</p>
        <p class="pram">段落2</p>
        <p class="pram">段落3</p>
        
    </div>

    <p class="pram">段落3</p>
    <script>
        var p=document.getElementsByClassName("pram")
        console.log(p);
        for(var i=0;i<p.length;i++)
        {
            p[i].innerHTML='这是js控制的html'+i
        }
    </script>
    
</body>
</html>